<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xmlns:aop="http://www.springframework.org/schema/aop"
	   xmlns:util="http://www.springframework.org/schema/util"
	   xmlns:context="http://www.springframework.org/schema/context"
	   xmlns:tx="http://www.springframework.org/schema/tx"
	   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
	
	<context:annotation-config/>
	
	<context:component-scan base-package="org.vsg"/>
	<context:component-scan base-package="edu.gtcfla.km"/>
	

	<!-- ========================= GENERAL DEFINITIONS ========================= -->
	<!-- 
		over load the property setting handle object , if this property setting is not defined ,that will 
	<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="location" value="/WEB-INF/configuration.properties"/>
	</bean>
	 -->
  	<bean id="propertyConfigure" class="org.vsg.common.configration.SystemPathPropertiesOverridePlaceHolder">   
    	<property name="locations" value="/WEB-INF/configuration.properties" />
    	<property name="userTreePath" value="edu.gtcflakm" />
  	</bean>
  	
  	<!-- 	 
	<bean id="propertyConfigurer" class="org.vsg.common.configration.SimplePropertiesPlaceHolder">
		<property name="configPath" value="system:config.path"/>
	</bean>
	 -->		 
	 

	<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
		<property name="driverClassName" value="${jdbc.driverClassName}"/>
		<property name="url" value="${jdbc.url}"/>
		<property name="username" value="${jdbc.username}"/>
		<property name="password" value="${jdbc.password}"/>
	</bean>

	<bean id="sessionFactory" class="org.vsg.common.orm.hibernate4.ModuleAnnotationSessionFactoryBean">
		<property name="dataSource" ref="dataSource" />
		<property name="domainFile" value="META-INF/module-domain.xml" />
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">${hibernate.dialect}</prop>
				<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
				<prop key="hibernate.format_sql">true</prop> 
			</props>
		</property>		
	</bean>

	<bean id="txManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
		<property name="sessionFactory"><ref local="sessionFactory"/></property>
	</bean>

	<!-- out mesage  -->
	<!-- message bundle -->
	<bean id="messageSource" class="org.vsg.common.i18n.ScanJarResourceBundleMessageSource">
		<property name="basenames">
      		<list>
        		<value>classpath:i18n/messages</value>
        		<value>classpath:i18n/error</value>
      		</list>
    	</property>
		<property name="resources">
      		<list>
        		<value>classpath*:i18n/messages</value>
        		<value>classpath*:i18n/error</value>
      		</list>
    	</property>
	</bean>
	
	<bean id="pageManager" class="org.vsg.common.page.hiberante4.HibernatePaginationManager">
		<property name="sessionFactory"><ref local="sessionFactory"/></property>
	</bean>
	
	<bean id="i18nMessage" class="org.vsg.common.i18n.impl.I18nMessageServiceImpl" />

	<bean id="unifiedIDProvider" class="org.vsg.biz.uid.IdGenerator" />

	<bean id="businessEntityFactory" class="org.vsg.biz.BusinessEntityFactory" factory-method="getInstance" />

	
</beans>
